Skip to content

DD optimiser, force-frequency option, Network.connect_fan_in, literature register - #44

Merged
RaulSimpetru merged 11 commits into
mainfrom
feat/dd-optimiser-tooling
Nov 7, 2026
Merged

RaulSimpetru merged 11 commits into
mainfrom
feat/dd-optimiser-tooling

Conversation

@DRohlf

@DRohlf DRohlf commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Third of four stacked PRs that replace #41: #40 → #43 → this → #45. Base is fix/fdi-ported-fixes; retarget to main once #43 merges.

Closes #38, closes #39.

  • FDI descending-drive calibration tooling #38 Multilevel descending-drive optimiser in the gallery as examples/02_finetune/06_optimize_dd_multilevel.py, with 07_fdi_spikes_force.py (MVC, % MVC excitation and benchmark spike trains from an optimised drive). Utilities: parallel_budget, pluggable rate-coding targets (fr_optimization_targets), ramp_analysis (recruitment curves, % MVC and CV-from-recruitment-force helpers).

  • New public Network.connect_fan_in: equal fan-in with per-target weights, replacing the optimiser's private _create_netcon / _select_synapse imports. It draws in the same order, so calibrated networks reproduce; print_network lists it.

  • Human-unit force-frequency option on ForceModel (opt-in; default unchanged).

  • Literature register and inline citations #39 Literature register (docs/literature.md, 82 sources, generated by scripts/build_literature.py) and [key p. N] inline citations, checked by a test.

  • Docs gallery: 06_optimize_dd_multilevel and 07_fdi_spikes_force render source-only (filename_pattern and SOURCE_ONLY); a test checks that executed examples guard __file__ and that the two lists agree.

  • Fuglevand et al. 1993 locators for the force-frequency saturation (p. 2475 eqs. 16–17).

Tests. Full suite at e498faa9f: 469 passed, 2 skipped. The last commit changes comments and the register only (register tests pass).

… weights

Every target neuron receives exactly n_inputs excitatory inputs, drawn
without replacement in target order, each with its target's weight. The
draws match the loop the DD optimiser used with the private
_create_netcon/_select_synapse helpers, so calibrated networks rebuild
identically.
ForceModel(force_frequency_shape=(a, c)) sets S(r) = 1 - exp(-a r^c) in
the Fuglevand gain; the default (2, 3) is unchanged.
force_utils.HUMAN_UNIT_FORCE_FREQUENCY (0.93, 1.29) is fitted to human
single motor units stimulated through their axons.
Port the multilevel descending-drive optimiser and the FDI excitation to
% MVC mapping into the fine-tuning gallery as 06_optimize_dd_multilevel.py
and 07_fdi_spikes_force.py, with fr_optimization_targets,
parallel_budget and ramp_analysis. Against the review: the scripts use
Network.connect_fan_in instead of private network helpers, no longer
silence all warnings, and write results under the repository results/
root instead of a missing examples/basic.
docs/literature.md is generated by scripts/build_literature.py and
tests/test_literature_register.py fails when it is stale or the code
cites an unknown key. Sourced constants cite [key locator]; where a
numbered reference and a key were both given, the number is dropped.
The optimiser, the rate-coding targets and the literature register pointed at
ticket and note IDs in a private notebook that readers of the repo cannot open.
The optimiser moved from examples/finetune to examples/02_finetune, but the
citation scan still listed the old folder, so its citations went unchecked.
A test now requires every scanned folder to exist.
…ript source-only

On pushes to main the docs build executes examples/02_finetune with exec(),
where __file__ is undefined, and without arguments; 06 and 07 use __file__ at
module level and 07 takes two positional arguments, so the build would fail.
Both are now excluded in filename_pattern and SOURCE_ONLY, like
16_adaptive_cpu_execution. A test checks that executed examples guard
__file__ and that the two source-only lists agree.
Read in full: S(T/ISI) = 1 - exp(-2 (T/ISI)^3) is eq. 16 and the gain S/(T/ISI)
above 0.4, scaled to its value at 0.4, is eq. 17 (p. 2475), as fuglevand_gain
implements; twitch:tetanus 0.11 is on the same page. The register entry is now
full text with the equations used.
@DRohlf
DRohlf changed the base branch from fix/fdi-ported-fixes to main November 7, 2026 16:52
@RaulSimpetru
RaulSimpetru merged commit 509fd9f into main Nov 7, 2026
20 checks passed
@RaulSimpetru
RaulSimpetru deleted the feat/dd-optimiser-tooling branch November 7, 2026 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Literature register and inline citations FDI descending-drive calibration tooling

2 participants